#include "UnitGroup.h"

BasicAction::BasicAction()
{
	group = NULL;
	stopped = true;
}

void BasicAction::start()
{
	stopped = false;
	_onActionStart();
}

void BasicAction::stop()
{
	stopped = true;
	_onActionStop();
	group->onActionCompleted(this);
}

void BasicAction::think()
{
	if(group == NULL)
		return;
	if(!stopped && !group->getUnits()->empty())
		_onFrame();
}

/*bool ActionCompare::operator() (BasicAction* lhs, BasicAction* rhs) 
{
	return(lhs->getPriority() < rhs->getPriority());
}*/